import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins/element.js'
import './assets/public.css'

import utils from './assets/utils'
//swiper
import 'swiper/swiper-bundle.css'
import VueAwesomeSwiper from 'vue-awesome-swiper'
import Swiper, {Autoplay} from 'swiper';
Swiper.use([Autoplay]);
Vue.use(VueAwesomeSwiper, /* { default options with global component } */)

//公共函数
Vue.prototype.$utils = utils;

Vue.config.productionTip = false

//路由跳转后定位页面顶部
router.beforeEach((to, from, next) => {
    // chrome
    document.body.scrollTop = 0
    // firefox
    document.documentElement.scrollTop = 0
    // safari
    window.pageYOffset = 0
    next()
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
